<?php
class SettingSaveApiAction extends AdminAction
{
	public function __construct()
	{
		parent::__construct();
		$this->responseType = 'json';
	}
	
	protected function afterConstruct()
	{
		$this->parseDtds('api','setting');
	}
	
	public function execute()
	{
		$data = $this->getValidData();
		$update = array();
		foreach($data as $k=>$v)
		{
			$update['api.'.$k] = str_replace('"', '', $v);
		}
		
		Util::updateSetting($update);
		
		$this->code = 200;
	}
}
